# -*- coding:utf-8 -*-
# @Time:2023/5/22 8:48
# @Author: cevent
# @name=celery容器配置config-消费者（中间人）-获取到的消息队列及消息处理

# 配置消息存放容器redis(在10号库)
broker_url = "redis://:cevent619Rs@192.168.139.130:6379/10"
result_backend="redis://:cevent619Rs@192.168.139.129:6379/11"

# 时区，不指定默认为UTC
timezone = "Asia/Shanghai"

# 为防止内存泄漏，一个进程执行过N次之后杀死，建议是100次
worker_max_tasks_per_child = 100

# 错误 DatabaseWrapper objects created in a thread can only be used in that same thread
CELERY_TASK_ALWAYS_EAGER = True

# 导入指定的任务模块
taskImport=(
    'celery_tasks.demo.taskDemo',
    'celery_tasks.demo.taskDemo2'
)